import request from '@/router/axios';



export const getList = (page,size,dictTypeId, params) => {
  return request({
    url: '/api/dict/list',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      ...params,
      page,
      size,
      dictTypeId
    }
  })
}
export const remove = (dictId) => {
  return request({
    url: '/api/dict/delete',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      dictId,
    }
  })
}
//检查投诉主题是否已经被使用
export const checkAlreadyUse = (subject) => {
    return request({
        url: '/base/complaint/checkAlreadyUse',
        method: 'post',
        meta: {
            isSerialize: true,
        },
        data: {
            subject,
        }
    })
}

export const add = (row) => {
  return request({
    url: '/api/dict/addItem',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/dict/editItem',
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: row
  })
}

export const getDict = (dictId) => {
  return request({
    url: `/api/dict/detail`,
    method: 'post',
    meta: {
      isSerialize: true,
    },
    data: {
      dictId
    }
  })
}